<template>
  <v-layout class="release-container" justify-start align-start wrap>
    <v-flex md12 text-xs-left>
      <v-btn flat round @click="$router.go(-1)">
        <ui-icon icon="angle-left fa-lg"></ui-icon>
        <div class="ml-2">返回</div>
      </v-btn>
    </v-flex>
    <v-flex md8  pt-4>
      <v-layout justify-start align-center wrap px-5>
        <v-flex md12 d-flex align-center justify-start>
          <v-flex md4>
            <span class="subTitle title-color">用户名</span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{ user.nickName }}</span>
          </v-flex>
        </v-flex>
        <v-flex md12 d-flex align-center justify-start>
          <v-flex md4>
            <span class="subTitle title-color">手机号码</span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{ user.mobilePhone }}</span>
          </v-flex>
        </v-flex>
        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">注册IP地址 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.loginIp}}</span>
          </v-flex>
        </v-flex>

        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">会员类型 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.userType}}</span>
          </v-flex>
        </v-flex>
        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">QQ号码 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.userQq}}</span>
          </v-flex>
        </v-flex>

        <!-- <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">微信号码 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.userQq}}</span>
          </v-flex>
        </v-flex> -->

        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">注册时间 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{getTime(user.createTime)}}</span>
          </v-flex>
        </v-flex>

        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">最近登录时间 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{getTime(user.checkTime)}}</span>
          </v-flex>
        </v-flex>

        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">最近登录IP地址 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.loginIp}}</span>
          </v-flex>
        </v-flex>

        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">登录次数 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.loginNumber}}</span>
          </v-flex>
        </v-flex>

        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">账号余额 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.balance}}</span>
          </v-flex>
        </v-flex>

        <!-- <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">账号金币 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.nickName}}</span>
          </v-flex>
        </v-flex> -->

        <!-- <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">邀请人 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.nickName}}</span>
          </v-flex>
        </v-flex> -->

        <!-- <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">支付宝账号 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.nickName}}</span>
          </v-flex>
        </v-flex> -->

        <!-- <v-flex md12 mt-4 d-flex align-center justify-center>
          <v-flex md4>
            <v-btn large round color="primary" @click="onSave">
              <span class="title">保存</span>
            </v-btn>
          </v-flex>
        </v-flex> -->
      </v-layout>
    </v-flex>
  </v-layout>
</template>


<script lang="ts">
// 使用类装饰器
import { Component, Vue } from "vue-property-decorator";
import { KV } from "@/utils/type";
import { Todo, User } from '@/api';
import { getTime } from "@/utils/commonUtils";
declare const $Vue: Vue;

@Component({})
export default class TopupAudit extends Vue {
  private genderTypes: Array<KV> = [
    {
      text: "男",
      value: 1
    },
    {
      text: "女",
      value: 2
    }
  ];

  private adminStatus: Array<KV> = [
    {
      text: "是",
      value: 1
    },
    {
      text: "否",
      value: 2
    },
  ];

  private user: any = {
  };
  private getTime(date: string) {
    return getTime(date);
  }

  protected mounted() {
    let user: any = sessionStorage.getItem('BuyerDetail');
    this.user = JSON.parse(user);
    this.getUserInfo()
  }

  private onSave() {

  }

    /**
   * 获取买家用户信息
   */
  private async getUserInfo() {
    const params: any = {
      userId: this.user.userId
    };
    const { data } = await User.getSingleUserInfo.r(params);
    console.log("getUserInfo", data);
    if (data.result === 0) {
      this.user = data.data;
    }
  }
}
</script>

<style lang="less" scoped>

</style>


